namespace ne   {
    export class Module {
        /**注册代理列表*/
        private _resigerProxys: { new(module: Module): Proxy }[];

        /**代理实例集合*/
        private _proxyClassMap: Map<{ new(module: Module): Proxy }, Proxy> = new Map();

        onStart(){}

        /**注册代理列表*/
        registerProxys(): { new(module: Module): Proxy }[] {
            return [];
        }

        /**
         * 获取代理,由于代理全局唯一，因此，只需要通过代理类名引用即可
         * @param $proxyClass 代理名
         * @return 
         * 
         */
        getProxy($proxyClass: { new(module: Module): Proxy }): Proxy {
            return this._proxyClassMap.get($proxyClass);
        }

        /**启动Proxy*/
        startProxy(): void {
            this._resigerProxys = this.registerProxys();
            let _id = 0;
            for (let i = 0, l = this._resigerProxys.length; i < l; i++) {
                let proxyClass = this._resigerProxys[i];
                let _proxyInstance: Proxy = new proxyClass(this);
                this._proxyClassMap.set(proxyClass, _proxyInstance);
                _proxyInstance.startEvents();
            }
        }
    }

}